import request from '../kit/request'

export function login(username: string, password: string) {
  const data = { username, password }
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}

export function sync() {
  return request({
    url: '/auth/sync',
    method: 'post'
  })
}

export function changePassword(opwd: string, npwd: string) {
  const data = { opwd, npwd }
  return request({
    url: '/auth/change-password',
    method: 'post',
    data
  })
}
